package com.lxk.service;

import com.lxk.pojo.Refund;
import com.lxk.vo.PageModel;
import com.lxk.vo.RefundDetailModel;
import com.lxk.vo.RefundModel;

/**
 * @author JohnSoybean
 * @create 2020/3/31 16:08
 * @description 退款服务层
 */
public interface RefundService {

    /**
     * 后台主动退款：生成退款订单
     * 处理用户请求：修改退款状态
     * @param ordersId
     * @return
     */
    Integer generateRefundOrder(Integer ordersId);

    /**
     * 退款回调：修改退款订单信息
     * @param ordersId
     * @param refundStatus
     * @return
     */
    Integer changeRefundStatus(Integer ordersId, Integer refundStatus);


    /**
     * 回退优惠券使用情况
     * @param ordersId
     * @return
     */
    Integer rollbackCoupon(Integer ordersId);

    /**
     * 获取退款请求总页数
     * @param num
     * @return
     */
    Integer getTotalPages(Integer num, Integer refundStatus);

    /**
     * 获取退款分页
     * @param pageIndex
     * @param num
     * @param totalPages
     * @param sort
     * @param order
     * @return
     */
    PageModel<RefundModel> selRefundPage(Integer pageIndex, Integer num, Integer totalPages, Integer sort, Integer order, Integer refundStatus);

    /**
     * 拒绝退款
     * @param refundId
     * @return
     */
    Integer rejectRefund(Integer refundId);

    /**
     * 查找退款申请
     * @param refundId
     * @return
     */
    Refund selRefundById(Integer refundId);

    /**
     * 获取退款详情
     * @param refundId
     * @return
     */
    RefundDetailModel getRefundDetail(Integer refundId);

}
